The Horizon-AGN simulation: evolution of galaxy properties over cosmic time