The Queen praised young “writers of the future” as she presented the prizes during the final of a national writing competition at Buckingham Palace.