without rubbing the urethral meatus (the hole where the urine
(pee) comes out) should not be related to uti's.
That means one can have a UTI regardless of one's masturbation. Mutual masturbation is a little more risky because one person may not know where the other person's urethral meatus is. It may be wise to learn one's anatomy to avoid rubbing somebody wrong.