It doesn't matter. The relevant tax is Capital Gains Tax, and you'll end up with the same gain (or loss) in GBP no matter how you calculate it. You do need to keep records to show how you calculated the gain/loss, but you won't need to actually include them in your tax return.
The fundamental point is that you are starting with some GBP, use it to buy some USD, then use all the USD to buy stocks, and then later doing the same in reverse to get some GBP. No matter how you add it up, your eventual gain/loss is just the ending GBP minus the starting GDP. Anything more complicated you to do calculate the gain/loss should just cancel out.
If you ended up holding some USD for some time, and it crossed a tax year boundary, then you might need to separate out the calculation and gains to work out how
much is attributable to each tax year. But that seems quite unlikely in the scenario you describe.