Let $M$ be the midpoint of $AC$. Let $K$ be the projection of $M$ on $AA_1$. As $\angle CA_1A=90^\circ=\angle MKA$ we have $A_1C\parallel MK$. So, $K$ is midpoint of $AA_1$. So, $PK\parallel BA$. So $$\angle PKQ=90^\circ-\angle PKA_1=90^\circ-
\angle BAA_1=\angle C_1HA$$. As $\angle CC_1A=\angle CA_1A=90^\circ$ it follows $A_1,C_1,C,A$ lie on a circle. So, we have $\triangle CHA\sim\triangle A_1HC_1$. So, $$\angle PHC_1=\angle MHA=\angle QHA.$$Hence, $$\angle PHQ=\angle C_1HA=\angle PKQ.$$Thus, $P,H,K,Q$ are concyclic. Hence, $\angle QPH=180^\circ-\angle HKQ=90^\circ$. $\blacksquare$
[asy][asy]
import olympiad;
size(300);
pair A,B,C,M,A1,C1,K,Q,P,H;
A=(12,0);
B=(4,8);
C=origin;
draw(A--B--C--cycle);
M=(A+C)/2;
C1=foot(C,A,B);
A1=foot(A,B,C);
draw(C--C1);
draw(A--A1);
draw(A1--C1);
K=foot(M,A,A1);
P=(A1+C1)/2;
Q=2K-M;
draw(Q--M);
draw(Q--P);
draw(circumcircle(Q,K,P),red);
draw(circumcircle(A,C,A1),blue+dotted);
H=orthocenter(A,B,C);
draw(P--H);
draw(P--K);
draw(H--Q);
dot("$A$",A,E);
dot("$B$",B,N);
dot("$C$",C,W);
dot("$M$",M,S);
dot("$A_1$",A1,NW);
dot("$C_1$",C1,NE);
dot("$P$",P,N);
dot("$K$",K,SE);
dot("$Q$",Q,NE);
dot("$H$",H,S);
[/asy][/asy]