Rotational dynamics and its relation to the photovoltaic effect of CH3NH3PbI3 perovskite