The infrared-luminous progenitors of high-zquasars