We accurately determine the fundamental system parameters of the neutron-star X-ray transient Cen X-4 solely using phase-resolved high-resolution UVES spectroscopy. We first determine the radial-velocity curve of the secondary star and then model the shape of the phase-resolved absorption line profiles using an X-ray binary model. The model computes the exact rotationally broadened phase-resolved spectrum and does not depend on assumptions about the rotation profile, limb-darkening coefficients and the effects of contamination from an accretion disk. We determine the secondary star-to-neutron star binary mass ratio to be 0.1755+/-0.0025, which is an order of magnitude more accurate than previous estimates. We also constrain the inclination angle to be 32 (+8; -2) degrees, Combining these values with the results of the radial velocity study gives a neutron star mass of 1.94 (+0.37; -0.85) Msun consistent with previous estimates. Finally, we perform the first Roche tomography reconstruction of the secondary star in an X-ray binary. The tomogram reveals surface inhomogeneities that are due to the presence of cool starspots. A large cool polar spot, similar to that seen in Doppler images of rapidly-rotating isolated stars is present on the Northern hemisphere of the K7 secondary star and we estimate that about 4 per cent of the total surface area of the donor star is covered with spots. This evidence for starspots supports the idea that magnetic braking plays an important role in the evolution of low-mass X-ray binaries.