The majority of extra-solar planets have been discovered (or confirmed after follow-up) through radial-velocity (RV) surveys. Using ground-based spectrographs such as High Accuracy Radial Velocity Planetary Search (HARPS) and HARPS-North, it is now possible to detect planets that are only a few times the mass of the Earth. However, the presence of dark spots on the stellar surface produces RV signals that are very similar in amplitude to those caused by orbiting low-mass planets. Disentangling these signals has thus become the biggest challenge in the detection of Earth-mass planets using RV surveys. To do so, we use the star's lightcurve to model the RV variations produced by spots. Here we present this method and show the results of its application to CoRoT-7.