Photoconductivity of an inhomogeneous semiconductor