Aviva has agreed a deal to buy rival insurer Direct Line in a £3.7 billion swoop.