Nonlinear power spectra of dark and luminous matter in the halo model of structure formation