The role of nanomaterials in solar cells