Why do they compete in the Olympics as the UK, but they compete in the World Cup as England?

Which one is an actual country?