The Kähler-Yang-Mills equations and gravitating vortices