Study of photocurrent generation in InP nanowire-based p+-i-n+ photodetectors