Effect of perpendicular magnetic fields on the resistive transition of superconducting films