Since the existing answers were written, Xcode's interface has been updated and they're no longer correct (notably the Click on Window, Organiser // Expand the Teams section step). Now the instructions for importing an existing certificate are as follows:
To export selected certificates
- Choose Xcode > Preferences.
- Click Accounts at the top of the window.
- Select the team you want to view, and click View Details.
- Control-click the certificate you want to export in the Signing Identities table and choose Export from the pop-up menu.
- Enter a filename in the Save As field and a password in both the Password and Verify fields. The file is encrypted and password protected.
- Click Save. The file is saved to the location you specified with a .p12 extension.
Source (Apple's documentation)
To import it, I found that Xcode's let-me-help-you menu didn't recognise the .p12 file. Instead, I simply imported it manually into Keychain, then Xcode built and archived without complaining.