Massive and red objects predicted by a semianalytical model of galaxy formation