Theory of second-harmonic generation from multilayer systems based on electric point-dipole radiation: Application to magnetic multilayers