Velocity-Verlet-like algorithm for simulations of stochastic dynamics