Time-dependent density functional study of the electronic spectra of oligoacenes in the charge states -1, 0, +1, and +2