Stochastic acceleration of electrons. I - Effects of collisions in solar flares