Stochastic acceleration of electrons in solar flares