The Obata equation with Robin boundary condition