There are two problems with spray foam insulation. One it contracts by 15% over time, this means your heat will escape through the gaps. Two, if you should develop a leaking roof, then it may be a long time before you know about it. You will probably discover the leak after there has been major damage to the roof, like a partial collapse.
Kingspan or one of the other versions of polystyrene is safer, it can be installed leaving a one to two inch gap between it and the underneath of the roof, this will enable the air to dry out small leaks and will advise you of larger leaks before they cause a lot of damage.
Because polystyrene sheet, needs to be a push tight fit, gaps equal heat loss, this is probably best done as a diy job.
One of the reasons that UK homes loose so much heat is, rather unfortunately, that the workmanship is poor, builders seem to work on the principal that it does not matter if a job is done badly, provided it is hidden from the customer.
Before you do this, may I ask if you intend to use the loft as living space?
If you do not, then you will get the better result, fitting the insulation at ceiling level, it will also be easier. Fill the spaces between the joists with polystyrene, and if you want the best result, fit another layer of two inch thick polystyrene under the joists, the cover with plasterboard and finish to choice.
As heat rises, having a hot loft/attic, if you do not live in it is a waste of money. Save money by having your comfort zone as small as possible.