A 32-year-old man is evaluated for a painful purple area on the penis and the thigh that appeared 2 days ago. He describes a burning and stinging sensation associated with the lesion. He recalls having a similar episode several months ago that resolved spontaneously. He otherwise feels well. Medical history is unremarkable, and his only medication is as-needed ibuprofen for occasional musculoskeletal pain. He has had no sexual partners in the past 6 months.

On physical examination, vital signs are normal. Skin lesions are shown.

There is no inguinal lymphadenopathy. The remainder of the physical examination is unremarkable.

Which of the following is the most likely diagnosis?