Although the Spanish are mostly relaxed about topless sunbathing, they do draw the line at nudity - and you will probably be arrested - unless you use a specifically designated beach, and these are usually signed.
If in doubt, ask at the nearest hotel reception desk, or the Tourist Information.