I am not familiar with UK law; it's also certainly possible something there is something to your contract that would change this answer, but I don't see how you can get that addressed without your contract in hand and a lawyer by your side.
I am currently paid well below the national average salary for my role, and I have little assurance of a substantial pay rise in the next two years
Seems like a good reason to be uncomfortable, but your pay has little to do with this particular project. If you feel you are not properly compensated, you should ask for a raise or leave for another job that you feel will pay you more fairly. Academics are typically paid less than their industry counterparts in my experience, and this is in part because they get to do more interesting stuff, so consider what your role is exactly and whether you're actually comparing yourself to a comparable role in all ways.
The amount that will be paid for this work would actually bring me up to that scale.
It's not clear to me how you've figured this exactly. Have you considered all overheads? If you quit your current job, would the other institution hire you at the contract rate? Presumably some of the money is going to overhead costs and your supervision, as well, have you considered that?
In any event, this isn't how compensation works for anyone. In private industry, companies contract out their employee's work all the time; there is only rough correspondence between what those companies bill for the work and what the employees doing the work are paid. There's even less correspondence when the work is done for an internal project - if you do 10% of the work on a project that brings in $20 million a year, the company doesn't write you a check for $2 million.
Even for private contractors who arrange and are paid for their own work directly, they do not bill based on the specific work performed but on a more general basis to cover all their costs in finding and bidding work, opportunity cost given being on one contract prevents them from taking other work, etc.
It's not clear to me that this money will not go to actually pay (at least in part) for a new, junior member of the team
It's perfectly reasonable for an entity that takes in money to spend it on something, such as staff. Money is fungible. You are being paid to do work, if you are unhappy with that arrangement you can leave and find another job.
Generally in academic work, work done today is used to obtain future funding for future work, directly or indirectly. Everyone is benefitting from work someone else already did before they started, and everyone's work will benefit other people later. I don't think it is fruitful to think of this owned entirely by you. You didn't get the job on your own, you weren't offered this contract as an individual but as part of a team, presumably because the team (and not just you) has shown a competence to get such work done.
the work is fulfilling, to a large extent, and will certainly contribute to my career development
These are good things to consider. The world is full of people with terrible bosses or working meaningless jobs; even if they are getting paid wads of money they can be absolutely miserable. Only you can weigh the salary differences against the other aspects that are harder to quantify.