The Queen and the Duke of Edinburgh have formally welcomed the King of Spain to the UK with a military spectacle full of pomp and pageantry.