European Union ministers have pushed through a deal to relocate 120,000 refugees, defeating fierce opposition from some central and eastern states within the bloc.