We model the time-variable absorption of Feii, Feiii, Siii, Cii and Crii detected in Ultraviolet and Visual Echelle Spectrograph (UVES) spectra of gamma-ray burst (GRB) 080310, with the afterglow radiation exciting and ionizing the interstellar medium in the host galaxy at a redshift of z = 2.42743. To estimate the rest-frame afterglow brightness as a function of time, we use a combination of the optical VRI photometry obtained by the RAPTOR-T telescope array, which is presented in this paper, and Swift's X-Ray Telescope (XRT) observations. Excitation alone, which has been successfully applied for a handful of other GRBs, fails to describe the observed column density evolution in the case of GRB080310. Inclusion of ionization is required to explain the column density decrease of all observed Feii levels (including the ground state D) and increase of the Feiii S level. The large population of ions in this latter level (up to 10% of all Feiii) can only be explained through ionization of Feii, as a large fraction of the ionized Feii ions (we calculate 31% using the Flexible Atomic and Cowan codes) initially populate the S level of Feiii rather than the ground state. This channel for producing a significant Feiii S level population may be relevant for other objects in which absorption lines from this level, the UV34 triplet, are observed, such as broad absorption line (BAL) quasars and ¿ Carinae. This provides conclusive evidence for time-variable ionization in the circumburst medium, which to date has not been convincingly detected. However, the best-fit distance of the neutral absorbing cloud to the GRB is 200-400 pc, i.e. similar to GRB-absorber distance estimates for GRBs without any evidence for ionization. We find that the presence of time-varying ionization in GRB080310 is likely due to a combination of the super-solar iron abundance ([Fe/H] = +0.2) and the low Hi column density (log N(Hi) = 18.7) in the host of GRB080310. Finally, the modelling provides indications for the presence of an additional cloud at 10 50 pc from the GRB with log N(Hi) ~ 19 20 before the burst, which became fully ionized by the radiation released during the first few tens of minutes after the GRB.