EU agrees on gas price cap after Germany drops opposition