Yes, if you want. You may have the UTI because of sex in the first place, so if it doesn't hurt to pee anymore and you are feeling better, you can have sex while you are still taking the antibiotics. If it hurts, don't do it. Many women will still have the urge to urinate more often until the infection is under control.
Remember to drink lots of fluids and be extra, extra careful about your sexual hygiene. Most UTIs are caused by bacteria from your colon that somehow gets transferred to your vaginal/urethral area. This can happen from contaminated fingers during foreplay to a wandering penis (even in a condom) that gets too near your anal opening. If you are having anal sex, then a UTI is just about guaranteed.
As soon as you finish having sex, try to urinate to flush out your urethral area, and try and drink as much as you can the next day as well. Keep those pipes flowing.
I'd suggest waiting. Sex causes friction, and the last thing you need is to add friction to infected, inflamed tissues. Also, drink a daily sugar free cranberry juice along with taking a daily cranberry supplement. Just make sure that your supplement is at least 500 milligrams. It works. I used to get them all the time, but since I have been taking the supplement, I haven't had one in years.
Just to clarify on the user who suggested drinking cranberry juice and taking cranberry supplements. I was just at the doctor with an uti and I told him I was drinking lots of cranberry juice to get rid of the infection. He told me that cranberry juice will help in preventing an uti but will not help get rid of one and the best thing to drink is lots of water at least one an hour. And of course, take the antibiotics prescribed. My suggestion is as soon as you feel like you have a uti get to the doctors and get antibiotics before the pain increases. And drink lots of water and use a heating pad.
Important: The opinions expressed in WebMD User-generated content areas like communities, reviews, ratings, blogs, or WebMD Answers are solely those of the User, who may or may not have medical or scientific training. These opinions do not represent the opinions of WebMD. User-generated content areas are not reviewed by a WebMD physician or any member of the WebMD editorial staff for accuracy, balance, objectivity, or any other reason except for compliance with our Terms and Conditions. Some of these opinions may contain information about treatments or uses of drug products that have not been approved by the U.S. Food and Drug Administration. WebMD does not endorse any specific product, service, or treatment. Do not consider WebMD User-generated content as medical advice. Never delay or disregard seeking professional medical advice from your doctor or other qualified healthcare provider because of something you have read on WebMD. You should always speak with your doctor before you start, stop, or change any prescribed part of your care plan or treatment. WebMD understands that reading individual, real-life experiences can be a helpful resource, but it is never a substitute for professional medical advice, diagnosis, or treatment from a qualified health care provider. If you think you may have a medical emergency, call your doctor or dial 911 immediately.