There are quite a few different ways to stretch the contrast of a low dynamic range image, all with slightly different tradeoffs in the actual effects (and side effects). One of the most common is what Photoshop calls "levels" - you essentially choose what levels in the histogram you want to call black, white, and a mid-gray. Here's a decent tutorial, based on Photoshop's version of that tool. Depending on what toolset you are using, other adjustments would be the brightness/saturation/contrast group, gamma correction or curves, or something like Ansel Adams' zone system (which darktable implements quite nicely).
No matter which method you use, you have to be careful to avoid unwanted side effects, like posterization/banding, unnatural color changes, enhancing noise too much, or making the image look artificial. You'll have to play with the relevant parameters to see what is acceptable to you.