Anomalous Josephson effect induced by spin-orbit interaction and Zeeman effect in semiconductor nanowires