A generalization of the perturbation method is applied to the problem of the radial and the non-radial oscillations of a gaseous star which is distorted by a magnetic field. An expression is derived for the perturbation of the oscillation frequencies due to the presence of a weak magnetic field when the equilibrium configuration is a spheroid. The particular application to the homogeneous model with a purely poloidal field inside, due to a current distribution proportional to the distance from the axis of symmetry, and a dipole type field outside is considered in detail. The main result is that the magnetic field has a large and almost stabilizing effect on unstableg-modes, particularly on higher order modes. With the considered magnetic field the surface layers appear to have a large weight.