Computer makers are selling fewer PCs at higher prices as a memory chip shortage drives costs upward. The shortage stems from the massive buildout of artificial-intelligence infrastructure and has spread to the personal-computer market, lifting prices while reducing units sold.