Theory of the Schottky barrier solar cell