BEIJING—Asian stock markets were mixed Wednesday as investors weighed the economic impact of the spread of the coronavirus’s Delta variant and Wall Street ended August with a gain for the seventh straight month. Shanghai and Hong Kong retreated while Tokyo and South Korea advanced. Wall Street’s benchmark S&P 500 declined 0.1 percent from the previous day’s record but ended August with a 2.9 percent gain. Investor optimism about stronger U.S. corporate profits and that the Federal Reserve will keep interest rates low is being tested by data showing the Delta variant is weighing on economic activity. On Tuesday, a U.S. business group, the Conference Board, reported consumer confidence fell sharply in August. Most of the decline was tied to the Delta variant, which has inundated hospitals with patients. The Shanghai Composite Index gained less than 0.1 percent to 3,544.95 and the Nikkei 225 in Tokyo rose 1.2 percent to 28,425.54. …