Liverpool agree a deal to sign Spain midfielder Thiago Alcantara from Bayern Munich for an initial £20m.