First-principles study of the structural and electronic properties of III-phosphides