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