The nonlinear response of a metallic film to the self-magnetic field of an ac transport current is investigated theoretically. The nonlinearity is due to a magnetodynamic mechanism which derives from the influence of the magnetic field of the current on the dynamics of the conduction electrons and is most typical for pure metals at low temperatures. The nonlinearity leads to a dependence of the surface impedance on the amplitude of the ac current. It is shown that the real part of the surface impedance, which is responsible for the Joule losses, has a smooth maximum as a function of the amplitude. The imaginary part of the surface impedance is also a nonmonotonic function of the amplitude and has a minimum.