Prince Philip has been admitted to hospital with an infection but he remains in good spirits, Buckingham Palace said.