The only way to know is to let a doctor see it. Herpes isn't typically a hard red bump - that could be lots of other things, but if you still have it, you should definitely let a doctor see it.
Are you using lube when you masturbate for that long? You should be. Be kind to your penis.
When you were diagnosed with the UTI, was it after tests, or just based on symptoms?