An accretion disc model for quasar optical variability