I'm no doctor, but I just went through something very similar. You have what sounds like balanitis. It can be caused by any number of things, yeast, fungus, dermatitis, drug interaction, etc.
Get in to see your doctor and have it swabbed to determine what the problem is and properly diagnosed.
It took me almost 2 months of false starts on treatments to figure out I had dermatitis.