  Phase curves, or the change in observed illumination of the planet as it
orbits around its host star, help us to characterize their atmospheres.
However, the variability of the host star can make their detection challenging:
the presence of starspots, faculae, flares and rotational effects introduce
brightness variations that can hide other flux variations related to the
presence of an exoplanet: ellipsoidal variation, Doppler boosting and a
combination of reflected light and thermal emission from the planet. Here we
present a study to quantify the effect of stellar variability on the
detectability of phase curves in the optical. On a first stage, we simulate
ideal data, with different white noise levels, and with cadences and total
duration matching a quarter of the \textit{Kepler} mission. We perform
injection and recovery tests to evaluate the minimum number of planetary orbits
that need to be observed in order to determine the amplitude of the phase curve
with an accuracy of 15\%. We also evaluate the effect of a simplistic stellar
variability signal with low amplitude, to provide strong constraints on the
minimum number of orbits needed under these ideal conditions. On a second
stage, we apply these methods to data from the quarter Q9 of the
\textit{Kepler} mission, known for its low instrumental noises. The injection
and recovery tests are performed on a selected sample of the less noisy stars
in different effective temperature ranges. Even for the shortest explored
planet period of 1 day, we obtain that observing a single orbit of the planet
fails to detect accurately more than 90\% of the inserted amplitude. The best
recovery rates, close to 48\%, are obtained after 10 orbits of a 1d period
planet with the largest explored amplitude of 150 ppm. The temperature range of
the host stars providing better recovery ratios is $5500 \text{K}<T_{eff}<6000
\text{K}$. [Abridged]
