Stellar magnetic fields are poorly understood but are known to be important for stellar evolution and exoplanet habitability. They drive stellar activity, which is the main observational constraint on theoretical models for magnetic field generation and evolution. Starspots are the main manifestation of the magnetic fields at the stellar surface. In this study we measure the variation of their latitude with time, called a butterfly diagram in the solar case, for the solar analogue HD 173701 (KIC 8006161). To that effect, we use Kepler data, to combine starspot rotation rates at different epochs and the asteroseismically determined latitudinal variation of the stellar rotation rates. We observe a clear variation of the latitude of the starspots. It is the first time such a diagram is constructed using asteroseismic data.