Multiple stellar populations in the globular cluster ω Centauri as tracers of a merger event