I would ask your midwife about her rationale. However, I *think* that uva ursi is more of a potential problem in early pregnancy. The reason for this could be that uva ursi works by making the bladder less "sticky" for bacteria, and so maybe it could increase risk of early m/c. But in an established late pregnancy, drinking it for a few days could be fine. (It should never be taken for more than a few days at a time.) I think wise woman herbalist Susun Weed recommends it in her book on pregnancy.
I used to use uva ursi tincture along with cranberry juice when I'd get awful UTIs and when I thought I had one during pregnancy, I was okay with doing the same regime for a few days. (In the end, I didn't have a UTI and didn't take anything.)
One thing about the UTI: DRINK TONS OF WATER. This is maybe the most important thing. And if you decide not to go with the Uva Ursi, there are other options.