Theresa May earlier held talks with the first minister, Arlene Foster, and Martin McGuinness, who resigned as deputy first minister last week, in a late effort to save the Stormont government, stressing that it had a role to play in Brexit negotiations.