Consumer confidence in Germany dropped unexpectedly sharply, dragged down by rising energy prices as tensions escalated in the Middle East.