A phase-field moving contact line model is presented for a two-phase system with soluble surfactants. With the introduction of some scalar auxiliary variables, the original free energy functional is transformed into an equivalent form, and then a new governing system is obtained. The resulting model consists of two Cahn-Hilliard-type equations and incompressible Navier-Stokes equation with variable densities, together with the generalized Navier boundary condition for the moving contact line. We prove that the proposed model satisfies the total energy dissipation with time. To numerically solve such a complex system, we develop a nonlinearly coupled scheme with unconditional energy stability. A splitting method based on pressure stabilization is used to solve the Navier-Stokes equation. Some subtle implicit-explicit treatments are adopted to discretize convection and stress terms. A stabilization term is artificially added to balance the explicit nonlinear term associated with the surface energy at the fluid-solid interface. We rigorously prove that the proposed scheme can preserve the discrete energy dissipation. An efficient finite difference method on staggered grids is used for the spatial discretization. Numerical results in both two and three dimensions demonstrate the accuracy and energy stability of the proposed scheme. Using our model and numerical scheme, we investigate the wetting behavior of droplets on a solid wall. Numerical results indicate that surfactants can affect the wetting properties of droplet by altering the value of contact angles.