Swiss voters have backed government plans to replace the power from ageing nuclear reactors with renewable energy.