Prime Minister Theresa May has used a visit to Wales to pledge to bring prosperity to all parts of the UK as the Brexit vote puts renewed pressure on the Union.