Nonlinear optics in magnetic nanostructures