The US merchandise-trade deficit narrowed in April, reflecting an increase in the value of exports of capital and consumer goods.