Stochastic method for analytic continuation of quantum Monte Carlo data