Boris Johnson said on Wednesday he would take Britain out of the European Union on Oct. 31 if he was still prime minister, proposing to hold a national election on Oct. 15.