You definitely need to treat the walls before painting - just slapping mold-resistant paint over existing mold won't solve anything. First, you've got to figure out where the moisture is actually coming from. Check if your bathroom has adequate ventilation (exhaust fan running during and after showers), since trapped humidity is usually the culprit. Once you've addressed that, clean the moldy areas thoroughly with a bleach solution or mold-specific cleaner, let everything dry completely, and consider using a mold-killing primer before you paint. If the mold has penetrated deep into drywall, you might need to replace that section entirely - just painting over it won't keep it from coming back.
As for the paint itself, mold-resistant paints are worth getting. They contain additives that prevent mold and mildew growth on the paint surface, which helps in bathrooms where moisture is inevitable. Look for bathroom-specific formulations that are labeled as mildew-resistant or moisture-resistant. A semi-gloss or satin finish will also be better than flat paint since it's easier to wipe down and less prone to trapping moisture. Make sure you've got solid ventilation going - that's honestly more important than any special paint. Run your exhaust fan for at least 20-30 minutes after showers, and if you don't have one, installing one should be your first priority before you even think about repainting.