Prince Philip, the longest-serving consort of a reigning British monarch, will retire from public engagements this autumn.