OTTAWA, Aug 30 (Reuters) - Investor demand for gold and silver in the wake of Britain's vote to leave the European Union in late June helped push Canadian producer prices up by 0.2 percent in July, Statistics Canada said on Tuesday.

Analysts in a Reuters poll had predicted a 0.1 percent decline from June. Overall, 13 of the index's 21 major components were higher, while five dropped and three were unchanged.

Prices for primary non-ferrous metal products rose by 5.3 percent, the largest month-on-month gain in almost four years, on higher demand for both unwrought precious metals and precious metal alloys.

"Given the financial market volatility following Britain's decision to leave the European Union, prices for precious metals increased as investors pursued safe-haven assets such as gold and silver," Statscan said in its daily commentary.