Shares of Levi Strauss & Co. rallied after hours on Wednesday after the jeans maker reported fourth-quarter results and a full-year sales forecast that beat expectations, as a strong performance at its own stores clashed with a harsher foreign-exchange backdrop.