The Duchess of Sussex said the education of women and girls in developing countries was "vital" in her first speech of the royal tour.