UTI and pregnancy

I'm 11 weeks pregnant and I have a UTI. I go to the doctor to get antibiotics soon. The antibiotics are usually a 7 day prescription. Will I be at risk for miscarriage? I'll be 12 weeks by the time I'm finished taking the medicine. I'm worried and cried because I don't want to lose the baby. I've never even had a UTI before.