Mobile operator O2 and broadband giant Virgin Media are to merge, creating one of the country's largest entertainment and telecoms firms.Liberty Global, which owns Virgin Media, and Spain's Telefonica, which owns O2, said they had agreed terms for joining forces.O2 is the UK's largest phone company with around 34 million users.Virgin has about six million broadband and cable TV customers and another three million mobile users.As well as having its own subscribers, O2 provides the network for Tesco Mobile, Giffgaff and Sky Mobile,The companies said O2 would be valued at £12.7bn and Virgin Media at £18.7bn, both on a total enterprise value basis.