Stochastic acceleration of electrons by turbulence in solar flares