Preparation of a photoanode with a multilayer structure for solar cells by extraction pyrolysis