Quasar spectral slope variability in the optical band