Although Martha went with a sheet of metal, we're thinking this could also be achieved with a few coats of magnetic paint. By going the latter route, you could even paint a top coat of your favorite color to finish off the project.
Instructions from the January 2006 issue of Martha Stewart Living:
Have galvanized metal cut to fit the back of the cabinet and inside the door. Adhere metal with caulk. (If your mirror has clips, loosen them, and slide the metal behind them.) Attach magnetized hooks, a notepad holder for brushes and combs, and spice canisters for hair elastics and barrettes. Group like items in votive holders and small acrylic boxes; double surface space with acrylic risers.