Zinsser has a great product line to deal with mold and mildew.
First, it sounds like you did a good job removing the current mildew. Properly installing the fan will help minimize future problems.
Zinsser has a couple of primers that you should check in to. "B-I-N" and "1-2-3." Both are great for sealing stains...but their use depends on what you want for a topcoat.
They also have another product, "Perma-White," that comes under their mildew-prevention line...two coats...the first acts as a sealer/primer, the second as a topcoat. I believe that it contains a mildewcide...and it's mildew protection may even be warranteed.
Lastly, should you want to use some other brand of paint, consider adding Zinsser's mildewcide additive to your chosen paint. I think it's called "Add-2"? Not quite sure...
Most "bath" paints have a mildewcide already in the formulation...but the Add-2 (or whatever it's called) will give added protection, and it's good to use in any paint formulation. Even bath paints.
Try an internet search...should be http://www.zinsser.com