In the time-domain finite element analysis of electromagnetic problems, the spatial discretization of the wave equation results in a second-order ordinary differential equation, which is usually discretized in the time domain with the Newmark-β method due to its second-order accuracy and unconditional stability. However, the commonly used uniform time-stepping scheme is not always the optimal choice. In this paper, a nonuniform time-stepping scheme is derived using the weighted residual approach. With the proposed method, the time-stepping sizes can be chosen according to the variation of the externally applied signal, which reduces the total number of time steps significantly. The nonlinear electromagnetic problem is analyzed with the proposed method, and its accuracy and efficiency are investigated and compared with the traditional uniform time-stepping scheme.