Stochastic noise can be helpful for variational quantum algorithms