Statutory maternity or paternity pay is a taxable social security benefit which is taxable in the UK (as UK-sourced income) under UK law, regardless of whether you are resident in the UK. If, however, you are resident in another country with which the UK has a double tax treaty when this income is received, it is necessary to consider the relevant Article of the treaty to determine whether the UK can continue to tax the income under the Treaty, or if this should only be taxable in your country of residence.
Additional maternity or paternity pay funded by your employer is regarded as employment income, although this is being paid for a period when you are not actively working. If you are resident in the UK when the payment is made, it would be regarded as taxable in the UK. If you are not resident, you are still taxable in relation to amounts that are considered to relate to days spent working in the UK, so it is necessary to consider where you would have been working had you not been on parental leave, which may be determined based on your expected work pattern, previous work pattern, the location of your contract or payroll and which entity ultimately meets these costs.
If you cease to pay UK National Insurance while abroad, the amount of your state retirement pension and your entitlement to some UK social security benefits may be affected. Therefore, you may wish to pay contributions voluntarily to maintain your benefits.
In particular, individuals have to pay National Insurance for a minimum of 10 years to qualify for a UK state pension and a maximum of 35 years to get a full UK state pension. So, if you stop paying National Insurance when you move abroad, the amount of UK state pension you ultimately receive (and your entitlement to some UK social security benefits) may be affected.
Voluntary contributions can be backdated for up to 6 years (so you may not need to decide immediately), and also may not be required in the tax year in which you stop paying ‘Class 1’ National Insurance on your employment income.
Please see the government website here for the conditions you have to fulfil to make voluntary contributions, the current rates for voluntary contributions, as well as how to pay.