First of all: Since the German orthography reform of 1996 "wieviel" is out of the question. You will find it in older texts, but since then you have to write it as "wie viel".
So it's was kostet versus wie viel kostet.
Fortunately, when asking for a price, there is nearly no difference and you can use both interchangeably 99 % of the time, but in everyday language it is more common to say "was kostet".
What are the differences?
Wie viel kostet – required amount
Was kostet – type of consideration
"Wie viel" always asks for a specific amount, e.g.,
Wie viel kostet die Fahrkarte? – 3,50 €
Wie viel kostet uns die Umweltverschmutzung? – xxx Milliarden Euro pro Jahr.
Wie viel kostet uns die Umweltverschmutzung? – xxx Tote pro Jahr.
"Was kostet" may ask for everything and can be used for more abstract questions, e.g.,
Was kostet die Fahrkarte? – 3,50 €.
Was kostet ein Pakt mit dem Teufel? – Deine Seele.
Was kostet uns die Umweltverschmutzung? – xxx Milliarden Euro pro Jahr.
Was kostet uns die Umweltverschmutzung? – Unsere Gesundheit.