I'm not focusing on religious view but that specific posture ( Ramadan prayer) for prolong time leads to pain, so
first- discontinue the posture by using alternative one if possible i.e. sitting on stool , if not possible then apply cushion and don't pray for prolong time, make it a small small session if possible as I have no idea about the ritual.
You can apply icepack initially, followed by isometric quadriceps exercise for 5 minutes.
Next Steps
if pain persist during rest also then go for physiotherapy session and take UST/IFT , followed by quadriceps exercise.
Health Tips
follow exercise routine regularly. strengthening exercises for quads , hams, mobilization of patella and knee joint.