Just to be clear--the sex was completely protected and the condom was intact? Can you tell me more about the ulcer?
OK--there are three possibilities here. One could be an allergic reaction to either the condom, or, if it were lubricated, to the lubrication. Second would be balanitis--a yeast infection but not an STD and that can be treated with Lamisil cream three times a day after washing with hypoallergenic soap and water. Finally, of course, with the possible ulcer, this could be herpes but with protected sex that would be very unlikely. I do suggest, however, that you have a doctor look at this and decide whether you need a culture for herpes.