Nationwide’s £2.9 billion takeover of rival Virgin Money has been approved by a judge.