Hysterectomy is not the traditional treatment for endometriosis. The primary reason is that it is not a cure for the disease, which is the growth of uterine tissue outside the uterus. That tissue is stimulated by estrogen, the majority of which is released by the ovaries. The uterus doesn't release any estrogen. The only reason I can think of for performing a hysterectomy because of endometriosis is if the endometrial tissue on the outside of the uterus was so severe that removing the entire organ was the only way to resolve it.
However, what's done is done, right? Nonetheless, it is important that you understand that removing your uterus doesn't mean your endometriosis is gone. It can exist in numerous other areas throughout your pelvic cavity. Yet while there are reports of endometriosis on the urethra (the tube from the bladder to the outside of your body through which urine passes) and even on the bladder itself, it is pretty rare. Thus, it is highly unlikely to be the cause of your UTIs.
If you're having recurrent urinary tract infections, talk to your health care professional about other causes. These could include not emptying your bladder enough; frequent and intensive sexual activity; even wearing underwear that is too tight. All can allow the introduction of bacteria into the bladder, leading to a painful UTI.
Share your concerns with your health care professional, particularly your worries about endometriosis causing the UTIs. Also talk about what you can do to prevent further UTIs. A few things that might help: Try to urinate every two to three hours, even if you don't feel you have to. This keeps urine moving through the urethra, keeping bacteria at bay. Also drink a glass of cranberry juice every day (the less sugar the better). Cranberry juice actually helps prevent UTIs by making the urine more acidic and, thus, less hospitable to bacteria. You can also talk to your health care professional about the possibility of prophylactic antibiotics that you take to prevent a UTI.
Between your health care professional and you, I'm sure you can get to the bottom of this problem.