The space experiment CoRoT has recently detected a transiting hot Jupiter in orbit around a moderately active F-type main-sequence star (CoRoT-Exo-4a). This planetary system is of particular interest because it has an orbital period of 9.202 days, the second longest one among the transiting planets known to date. We study the surface rotation and the activity of the host star during an uninterrupted sequence of optical observations of 58 days. Our approach is based on a maximum entropy spot modelling technique extensively tested by modelling the variation of the total solar irradiance. It assumes that stellar active regions consist of cool spots and bright faculae, analogous to sunspots and solar photospheric faculae, whose visibility is modulated by stellar rotation. The modelling of the light curve of CoRoT-Exo-4a reveals three main active longitudes with lifetimes between about 30 and 60 days that rotate quasi-synchronously with the orbital motion of the planet. The different rotation rates of the active longitudes are interpreted in terms of surface differential rotation and a lower limit of 0.057 pm 0.015 is derived for its relative amplitude. The enhancement of activity observed close to the subplanetary longitude suggests a magnetic star-planet interaction, although the short duration of the time series prevents us from drawing definite conclusions.