Nonequilibrium phase transition in systems of stochastically perturbed oscillators