Phone hacking trial told of affair between two former editors of the News of the World