Your pain in the back ,leg and the thigh could be an after effect of the UTI or could be due to some unnoticed trauma to yor back.You should see a neurologist so that a diagnosis can be done.You can take some NSAID to relieve the pain by consulting your doctor.
Just a thought. If you had a UTI did you have blood test to show renal function? Sometimes these infections can spread towards the kidneys. If your kidney functions is at all reduced I would steer clear of the NSAIDs. I am not a doctor, but I do know a lot about pain medication. Just wanted you to be aware that any potential renal problem is a no no for these types of drugs.