NEGF theory of quantum photovoltaic devices