A unified model for the spectrophotometric development of classical and recurrent novae