A UML diagram can be used both to model database designs and class designs, but an ER diagram should be used exclusively in database problems. How do you pick one graphical representation over the other?
There is no earth-shattering difference between a data model depicted in UML notation versus a data model depicted in any of the many common ER notations. They all depict the most important elements: entity types and relationships.
Depending on which graphical convention you choose, there may be other features of the model which are conveyed, such as the attributes of entity-types, relationship cardinality, strong or weak associations, etc.
The point of the model is to communicate your design.
You should choose the graphical convention that is most expressive of the information that you're trying to convey with the least "noise" (unimportant information).
You should also take into consideration the needs of your audience. No matter how artfully your diagram conveys the information you intend to transmit, if your audience isn't comfortable with the notation then you will have not achieved your goal. If your audience is familiar with IDEF1X then use that, if they are most comfortable with Martin or Chen then use those. If UML does the job and is what is familiar, then UML ER notation is best, otherwise it isn't.
I think you answered your own question. E-R diagrams are meant to be problem solving diagrams for the sake of creating a database schema, whereas UML are supposed to model a completed db. I personally don't place a huge amount of value on ER diagrams, as I would personally do such brainstorming in my head, but I imagine many people would swear by them. As such, the answer is UML as a general rule, but ER can hypothetically be useful in the construction of databases.