How to preserve Cycles material colours when exporting to .obj format?
As mentioned by Jebediah Kerman, the viewport color in Material > Settings is exported to the .mtl file:



If you only have a few simple materials, it can be quite trivial to copy the colors by using CtrlC and CtrlV while hovering over the color selection boxes.

If you have many materials, you could write a python script to take colors from the node tree and set the viewport color accordingly.

For example, here is a simple script that looks for diffuse shaders and sets the viewport color to the color of any diffuse shaders found:

import bpy

for mat in bpy.data.materials:
    if mat.use_nodes == True:
        tree = mat.node_tree
        for node in tree.nodes:
            if node.type == "BSDF_DIFFUSE":
                col = node.inputs["Color"].default_value
                mat.diffuse_color = (col[0],col[1],col[2])


Note that the Viewport color is actually diffuse_color.