We present high-resolution spectroscopic observations of GRB060418, obtained with VLT/UVES. These observations were triggered using the VLT Rapid Response Mode (RRM), which allows for automated observations of transient phenomena, without any human intervention. This resulted in the first UVES exposure of GRB060418 to be started only 10 minutes after the initial Swift satellite trigger. A sequence of spectra covering 330-670 nm were acquired at 11, 16, 25, 41 and 71 minutes (mid-exposure) after the trigger, with a resolving power of 7 km/s, and a signal-to-noise ratio of 10-15. This time-series clearly shows evidence for time variability of allowed transitions involving FeII fine-structure levels, and metastable levels of both FeII and NiII, at the host-galaxy redshift z=1.490. This is the first report of absorption lines arising from metastable levels of FeII and NiII along any GRB sightline. We model the observed evolution of the level populations with three different excitation mechanisms: collisions, excitation by infra-red photons, and fluorescence following excitation by ultraviolet photons. Our data allow us to reject the collisional and IR excitation scenarios with high confidence. The UV pumping model, in which the GRB afterglow UV photons excite a cloud of atoms with a column density N, distance d, and Doppler broadening parameter b, provides an excellent fit, with best-fit values: log N(FeII)=14.75+0.06-0.04, log N(NiII)=13.84+/-0.02, d=1.7+/-0.2 kpc (but see Appendix A), and b=25+/-3 km/s. The success of our UV pumping modeling implies that no significant amount of FeII or NiII is present at distances smaller than ~1.7 kpc (but see erratum in Appendix A), most likely because it is ionized by the GRB X-ray/UV flash. Because neutral hydrogen is more easily ionized than FeII and NiII, this minimum distance also applies to any HI present. [abridged]