Blender 2.69 Properly Export UV Maps Using Python
UV's aren't per vertex in Blender, but per loop (which means per face-vertex). Also see here and here.

For triangle export, use the tessellated faces and split the quads into triangles or triangulate using the bmesh operator. Export the faces together with the UV coordinates. If UVs are the same for a shared vertex, you could simply pick the first loop, otherwise interpolate? (may give weird results...)

Print loop and vertex indices per polygon together with UV coordinate (uv index equals loop index):

import bpy

me = bpy.context.object.data
uv_layer = me.uv_layers.active.data

for poly in me.polygons:
    print("Polygon", poly.index)
    for li in poly.loop_indices:
        vi = me.loops[li].vertex_index
        uv = uv_layer[li].uv
        print("    Loop index %i (Vertex %i) - UV %f %f" % (li, vi, uv.x, uv.y))