It's also extremely difficult to build a strong portfolio working at a bad company, because bad companies by their nature rarely get anything done, and even if they do, they'll pigeonhole you into the most monotonous tasks and you'll get 0 experience making architectural decisions or working on anything outside whatever little gutter they throw you in.
On the contrary, doing your own projects or contracting (ideally with startups or small companies) will force you to learn every level of the tech-business stack, from feature planning to architecture to coding to design to deployment to launching and promotion. You can work on many projects in a short timespan, and you'll be left with numerous portfolio pieces that are all your own.
"Most companies wouldn't even consider you as a contractor unless you have several years of solid experience. I can only assume you mean the kind of 'contracting' that happens at places like rentacoder.com."
This simply isn't true. You just need to sell yourself and show that you have good ideas and get things done. I got paid $60 per hour on my first rails project with no experience whatsoever in rails. The client never asked. She just saw that I had several strong pieces of work in my portfolio (half of them personal projects), and told me to use whatever tools I thought best for the job. If you're considering rent-a-coder you're definitely doing it wrong.
Don't settle for mediocrity. Take the initiative and start building a portfolio any way you can. The sky's the limit once you have a solid body of work to point to. You can make good money contracting or you can have your pick of awesome jobs. Having experience in some crappy job isn't what matters, it's showing that you can build great software.