Let's say you have the perfect UI (hypothetical of course) in terms of position of buttons, etc. Now would it be a better UI if you styled everything nicely, or would it not matter at all? Does a UI get better if you give it nice colors, even if everything else stays the same? I don't mean like "it's nicer to use". Would it actually be easier to use?
Of course it DOES matter. It's all about user experience. There are lots of things that can influence experience and visual style is among them. The UI would not only be nicer but really easier to use because of emotional factors.
What do you think about the restaurant with a perfect cuisine but with ugly interior? The interior design has no relationship with taste of meals but it is a very important part of your experience. And sometimes you may even prefer a restaurant with not-so-perfect menu because it has incredible interior.
You may read Donald Norman's Emotional Design for more on this.
Kostya's answer hits a lot of my initial thoughts, but there's another point: the color scheme and UI style affect usability. You want to use colors that are easy to read. You also want to use colors to present information to the user - make errors and warnings that occur during use stand out from informational messages, clearly identify required elements, and so on. None of this affects the layout, but has a clear impact on usability.
- Colors. Wrong colours can be hard to distinguish for colourblind people.
- Standard elements. If standard elements like fx links, submit buttons on a website looks very different than anticipated, it will be hard for the user to understand they he/she can click in these elements.
- Structure. An organized structure that's intuitive will help users find what they are looking for.
There are many more examples, but these are just some, that show how a design can ruin a UI.
It does matter and it most certainly does affect the experience of the user. This is just to add to other excellent answers here, but I highly recommend reading a book by Malcolm Gladwell called Blink. It goes into great detail about the process of our first impressions. Perception is affected by a large number of factors, one of them being color. One of the many studies that Gladwell cited was this [paraphrased, I don't have it in front of me]:
7-Up performed a study with their packaging. Without changing the recipe of their drink, they increased the amount of yellow on their label by 11%. When test subjects were poured 7-Up from one of the newly labeled bottles, they began complaining about it being too lemony and claimed that the flavor had changed.
I can give an unintentional personal example to this phenomena. I purchased some juice similar to this. It was supposed to be strawberry banana, but it didn't taste very much like it because of the other ingredients mixed in: carrots, apples, etc. I poured a glass for my wife, who said that she liked it. When I told her that it was strawberry banana, it suddenly didn't taste as good to her.
These are just two small examples, but the fields of rapid cognition and contextual priming are large and very interesting. The implications of how we make our decisions and judgments go far beyond just how something tastes; they reach every area of our lives. I read Blink almost a month ago now and I'm still processing it and trying to come to terms with it, not only for what it means for my designs, but also for the what it means for how I process the world.
I'll throw another angle in here too: any one UI is not the best UI for everyone - the perfect UI is different for me than it is for you. The UI should be flexible to the point of enabling scenarios for people with disabilities. Like googletorp indicated, color blindness and other vision impairments are a perfect example: you should support high contrast UI elements for some customers. Another consideration often overlooked is support for online screen readers - every element needs alt text and needs to be discoverable through screen readers for your application to be usable for the blind. MSDN has a great accessibility developer center covering various issues such as these and sharing tools for testing your UI in disability scenarios (the tools ship in the Windows SDK).
In my opinion, giving people choices on a particular UI and letting them while upholding to the standards for the platform you are building to is really the "perfect UI". And to go back to your question, enabling flexible UI's through themes and other customization methods, you can give your application a competitive advantage in the marketplace. Style does matter, so make sure to pay attention to details or consult a designer if you can when creating your applications and developing programs.
In my experience, if an interface doesn't look nice (be it an ugly website or poorly skinned desktop application) I normally have a bad experience while using it. Even if everything is easy to find, and works just like I expect it too -- if it's ugly, I find myself actively seeking out a product that looks better, even if it sacrifices some of the functionality of the first product.
And example of this is IDEs. I'm constantly frustrated in that every editor or IDE I find is either ugly or doesn't work well. Not that it doesn't work well for everybody, but I find myself unable to work effectively in it. I'll find one that works just how I want it but is ugly and I hate looking at it. I find one that looks really nice but I can't figure out how to do everything the first editor did. You need both.
An interface that provides good ux can be (and I think tends to be) perceived as being easier to use even though it really isn't (in terms of the time it takes to complete an task, etc), in comparison to an interface that does not provide good ux but has the same level of usability. So yes, style does matter.