The zcosmos survey: The role of the environment in the evolution of the luminosity function of different galaxy types