A variational approach to determine the optimal power distribution for cycling in a time trial