A weighted isoperimetric inequality and applications to symmetrization