Hi:
I am sorry that you are hurting...I have had this happen myself and know how painful it can be...My guess would be that you have a Urinary Tract Infection...This can make urinating very painful....It could have been caused by sex for the first time in a while and allowing bacteria to enter your Urethra or like you say the probable cause which would be wiping from the bowel movement...This is a culprit for all of us...You try and be careful but it just happens...
See a doctor...This will not go away by itself and can be very painful...I would suggest putting some Vaseline around the opening of the vagina to soothe the pain...This would make it feel better, but I think you will need an anti-biotic to fight this off....
I think so many of us forget to remember the two important things when we are having sex.....This being, "always to go to the bathroom before penetration and again immediately afterwards"...This does help...
Hopefully everything will be great the next time you make love....
Take care,
Caroline