Hi Andrew,
Class 4 National Insurance does not count towards your State Pension.
When you are self -employed, its only Class 2 National Insurance that counts towards your State Pension.
You will only be charged Class 4 National Insurance once your Self Employment profits exceeds £12,570 for the current tax year.
If your profit is below £12,570 you will not be charged Class 4 NIC
Please see guidance here:
Self-employed National Insurance rates
Thank you.