A historic compromise agreement has been reached within the European Union on rules governing the taxation of savings invested abroad.