We derive a mean-field model that is based on a two-component Pauli-like equation and incorporates quantum, spin, and relativistic effects up to second order in 1/c. Using a Lagrangian approach, we obtain the self-consistent charge and current densities that act as sources in the Maxwell equations. A physical interpretation is provided for the second-order corrections to the sources. The Maxwell equations are also expanded to the same order. The resulting self-consistent model constitutes a suitable semirelativistic approximation to the full Dirac-Maxwell equations.