There is no apex function to 'convert' a contact to partner contact, automatically creating the associated user.
Also you'll notice that if you click on 'Enable partner user' in the Contact screen on the Salesforce GUI, it will still take you to the new User screen (with some fields defaulted). So even SFDC follows a 2-step approach, which you will need to simulate in APEX.
So you need to stick to the solution of creating a user (with the right portal profile) and putting the ContactId in there.
E.g. assuming you have the Id of the contact as
Profile portalProfile = [select Id from Profile where UserType = 'PowerPartner' limit 1];
User theUser = new User(
Username = 'firstname.lastname@example.org',
ContactId = contactId,
ProfileId = portalProfile.Id,
Alias = 'test123',
Email = 'email@example.com',
EmailEncodingKey = 'UTF-8',
LastName = 'McTesty',
CommunityNickname = 'test123',
TimeZoneSidKey = 'America/Los_Angeles',
LocaleSidKey = 'en_US',
LanguageLocaleKey = 'en_US'