pose.bones.matrix does not update after frame change via script
To summerize, I needed to perform these changes:

for action in bpy.data.actions:
    bpy.context.object.animation_data.action = action # sets active action
    for frame in range(numberOfFrames):
        bpy.context.scene.frame_set(frame)
        bpy.context.scene.update()
        for bone in bpy.context.object.data.bones: # instead of armature.pose.bones
            poseBone = armature.pose.bones[bone.name]