Index funds do not contribute to the process of price discovery.
As long as a certain fraction of trades are performed by active investors, price discovery will continue to be accurate. Currently, active traders dominate, making up the majority of trades. This fraction could be much smaller than it currently is and still be OK.