Companies that manufacture baby food have been given 18 months by the government to cut sugar and salt levels in their products.