Sir Keir Starmer pledged to rebuild the UK's relationship with Europe in a defiant speech on Monday.