Apple Inc. showed off a new streaming-music service that will give users access to a vast inventory of songs for $9.99 a month, seeking to regain ground against upstarts that have lured listeners by offering unlimited access to music.