When a company writes off a loan made to a director the amount is treated as a dividend and as earnings for NICs purposes. In addition, it is an unallowable expense for Corporation Tax purposes.
Consider declaring a dividend to clear the loan as this will avoid the NICs charges.