  We study whether hierarchical galaxy formation in a concordance $\Lambda$CDM
universe can produce enough massive and red galaxies compared to the
observations. We implement a semi-analytical model in which the central black
holes gain their mass during major mergers of galaxies and the energy feedback
from active galaxy nuclei (AGN) suppresses the gas cooling in their host halos.
The energy feedback from AGN acts effectively only in massive galaxies when
supermassive black holes have been formed in the central bulges. Compared with
previous models without black hole formation, our model predicts more massive
and luminous galaxies at high redshift, agreeing with the observations of K20
up to $z\sim 3$. Also the predicted stellar mass density from massive galaxies
agrees with the observations of GDDS. Because of the energy feedback from AGN,
the formation of new stars is stopped in massive galaxies with the termination
of gas cooling and these galaxies soon become red with color $R-K>$5 (Vega
magnitude), comparable to the Extremely Red Objects (EROs) observed at redshift
$z\sim$1-2. Still the predicted number density of very EROs is lower than
observed at $z\sim 2$, and it may be related to inadequate descriptions of dust
extinction, star formation history and AGN feedback in those luminous galaxies.
