If the utility provider reports the account to a credit reference agency then it will be under the details of the account holder (Person A). Who is making the payments is moot. Some may not report, or only report if the account falls into default. There are also three main agencies and they may not report to all of them.
If the utility provider does report to credit references agencies, you could try adding both names to the account. However, the utility provider might only report under the primary account holder (making no difference to the second holder).
If the provider does report jointly, then both parties would have the (hopefully on-time) payments recorded against their credit histories. However, the credit reference agencies may link the two histories. This means that if one party has an adverse history, it can damage the other party's chances of acceptance for credit due to the link between them. Adding both names also means both parties become jointly and severally liable for the bill, i.e. they can chase either of you for the full amount of any overdue balance (not just half of it).
It should be noted that, in the UK, your "credit score" is not seen by lenders. You have a credit history. Lenders have their own "scoring" criteria which may take into account a variety of information, not just your credit history, and will weight different risk factors differently. Credit reference agents may provide you a score, but this is just a general indication, based on the information they have available and their experience of what many lenders generally look for in that data.