The leaders of Germany and France have agreed to scrap a landmark project to develop and build a new-generation fighter jet, officials say.